package com.spring.test;

import org.apache.commons.lang3.time.DateFormatUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class SpringScheduledTask {

	private static final Logger logger = LoggerFactory.getLogger(SpringScheduledTask.class);

	@Scheduled(cron = "*/5 * * * * ?")
	public void monitorHourly() {
		logger.info("Scheduled task at {}",DateFormatUtils.format(System.currentTimeMillis(), "yyyy-MM-dd HH:mm:ss"));
	}
	
}
